/*****************************************************************
 *   Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 ****************************************************************/
package org.epiphron;

import java.util.Collection;

/**
 * Data structure used to report the results of validation
 * or consistency checking operations.
 */
public interface ValidityReport {
	 /**
     * Returns true if no logical inconsistencies were detected. If it is false
     * then ether will be at least one error Report included. If it is true
     * then warnings may still
     * be present.  
     */
    public boolean isValid();
    
    /**
     * Returns true if the model is both valid (logically consistent) and no
     * warnings were generated. 
     */
    public boolean isClean();
    
    /**
     * Return an iterator over the separate ValidityReport.Report records.
     */
    public Collection<Report> getReports();
    
    public class Report {
    	ReportType type;
    	String description;
    	Object subject;
    	Object object;
    	
    	public Report(ReportType type, String description) {
    		this.type = type;
    		this.description = description;
    	}
    	
    	public Report(ReportType type, Object subject, Object object, String description) {
    		this.type = type;
    		this.description = description;
    		this.subject = subject;
    		this.object = object;
    	}
    	
    	public Object getObject() {
			return object;
		}
    	
    	public Object getSubject() {
			return subject;
		}
    	
    	public String getDescription() {
			return description;
		}
    	
    	public ReportType getType() {
			return type;
		}
    }
}
